﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CodeGenerator.Common
{
    public class FileDialog
    {
        public static SaveFileDialog SaveFileDialog(string filter, string fileName)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter = filter;

            saveFileDialog.FileName = fileName;


            if (saveFileDialog.ShowDialog() == DialogResult.No)
            {
                return null;
            }
            return saveFileDialog;
        }

        public static FolderBrowserDialog OpenFolderDialog()
        {
            FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
            folderBrowserDialog.ShowDialog();
            if (folderBrowserDialog.ShowDialog() == DialogResult.No)
            {
                return null;
            }
            return folderBrowserDialog;
        }

    }
}
